﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace HeathCareSystem.wuc
{
    public partial class wucTimBenhNhan : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            LoadControl();
        }

        protected void btnTimKiem_Click(object sender, EventArgs e)
        {
            BenhNhanDTO bn = new BenhNhanBUS().TimBenhNhan(txtMa.Text);
            List<BenhNhanDTO> lst = new List<BenhNhanDTO>();
            lst.Add(bn);
            gvBenhNhan.DataSource = lst;
            gvBenhNhan.DataBind();
        }

        protected void LoadControl()
        {
            DataTable dt = new DataTable();
            dt = LoaiBenhBUS.DanhSachLoaiBenh();
            ddlLoaiBenh.DataTextField = "TenBenh";
            ddlLoaiBenh.DataValueField = "MaBenh";
            ddlLoaiBenh.DataSource = dt;
            ddlLoaiBenh.DataBind();
        }
    }
}